package org.flexharmony.eclipse;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;

public class HarmonyLogger
{
  static public void logInfo(String message)
  {
    log(IStatus.INFO, IStatus.OK, message, null);
  }
  
  static public void logError(Throwable exc)
  {
    logError("Error: " + exc.getMessage(), exc);
  }
  
  static public void logError(String message, Throwable exc)
  {
    log(IStatus.ERROR, IStatus.OK, message, exc);
  }
  
  static public void log(int severity, int code, String message, Throwable exc)
  {
    log(createStatus(severity, code, message, exc));
  }
  
  static public IStatus createStatus(int severity, int code, String message, Throwable exc)
  {
    return new Status(severity, HarmonyPlugin.PLUGIN_ID, code, message, exc);
  }
  
  static public void log(IStatus status)
  {
    HarmonyPlugin.getInstance().getLog().log(status);
  }
}
